package com.bnu.graduate.Controller;


import com.bnu.graduate.Service.GraduateService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

@RestController
@RequestMapping(value = "/graduate")
public class GraduateController {

    @Resource
    private GraduateService graduateService;

    /**
     * 功能：查询当前grade下所有数据
     * 接口格式：http://localhost:8080/graduate/findAll?pageNo=1&pageSize=12&grade=2018
     */
    @ResponseBody
    @PostMapping(value = "/findAll")
    public Object findAllByGrade(HttpServletRequest request){
        return graduateService.findAllByGrade(request);
    }


    /**
     * 功能：高级搜索
     * 接口格式：http://localhost:8080/graduate/findGraduate?pageNo=1&pageSize=12&grade=&pa=&major=&des_type=&location=
     */
    @ResponseBody
    @GetMapping(value = "/findGraduate")
    public Object findGraduateByWrapper(HttpServletRequest request){
       return graduateService.findGraduateByWrapper(request);
    }
}